# 计算矩形面积
def juxingmianji(length,width):
    return length * width
result = juxingmianji(4,3)
print(result)

# 打印借阅书籍情况
def borrow_books(name,book,day):
    print(f"{name}借阅了书籍《{book}》,预计借阅{day}天")
borrow_books("小千","红楼梦",14)
borrow_books("小锋","西游记",10)

#求一个三位数个、十、百位的值
def cal_digit(number):
    high = number // 100
    mid = number // 10 % 10
    low = number % 10
    return high, mid, low
result = cal_digit(543)
print(result)
a,b,c = cal_digit(543)
print(a,b,c)

#判断单年份是不是闰年
def is_leap(year):
    """
    判单年份是不是闰年
    :param year:年份
    :return:返回值为布尔类型
    """
    if (year%4 == 0 and year%100 != 0) or year%400 == 0:
        return True
    else:
        return False
print(is_leap.__doc__)
#
def favorite_place(name,place):
    print(f"我的名字是{name}")
    print(f"我最喜欢的名胜古迹是{place}")
favorite_place("小千","万里长城")

#
def favorite_place(name,place):
    print(f"我的名字是{name}")
    print(f"我最喜欢的名胜古迹是{place}")
favorite_place(place="桂林山水",name="小锋")

#
def personinfo(*languages,**info):
    for key,value in info.items():
        print(f"{key}:{value}")
    print("喜欢的编程语言如下：")
    for language in languages:
        print(language,end=" ")
personinfo("C","C++","Python",id=1,name="小千",age=19,grade="大二")
